package com.ddwl.order.controller;

import com.ddwl.common.annotation.Auth;
import com.ddwl.common.constant.BaseEnum;
import com.ddwl.common.controller.BaseController;
import com.ddwl.order.service.UpdateService;
import com.ddwl.schema.vo.base.RestVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 订正数据
 *
 * @Date :2020-06-02 17:03.
 */
@Api(tags = "订正数据")
@Slf4j
@RequestMapping("/updateOrder")
@RestController
public class UpdateController extends BaseController {

    @Resource
    private UpdateService updateService;

    @PostMapping("/updateAddr")
    @Auth(product = {BaseEnum.ProductEnum.CONSOLE})
    @ApiOperation("更新订单地址列表")
    public RestVo page() {
        updateService.updateAddrOrder();
        return RestVo.ok();
    }


    @PostMapping("/updateSupplier")
    @Auth(product = {BaseEnum.ProductEnum.CONSOLE})
    @ApiOperation("更新订单供应商")
    public RestVo page2() {
        updateService.updateSupplier();
        return RestVo.ok();
    }

}
